"""
位置 VO
"""

from models import (
    VOBase,
    VOPage,
)
from models.other import (
    Dimensions,
    Vector3D,
)
from my_typing import *
from utils.data_utils.special import ObjectIdStr
from utils.mock_utils import Demo
from utils.validator_utils.pydantic_validator.field import (
    CharField,
    NormalField,
)


class FamilyPositionListVO(VOBase):
    """ 家庭 | 位置 | 列表 | VO """

    position_id: ObjectIdStr = CharField(..., title="位置 ID（ObjectId 字符串）", examples=[Demo.id])

    alias: StrOrNone = CharField(None, title="别名", min_length=3, max_length=32)
    dimensions: Dimensions | None = NormalField(..., description="位置的尺寸（长宽高）")
    furniture_id: ObjectIdStr = CharField(..., title="家具 ID（ObjectId 字符串）", examples=[Demo.id])
    name: str = CharField(..., title="名称", min_length=1, max_length=32)
    position_2_room: Vector3D | None = NormalField(None, title="位置（对于家具来说）")
    update_time: str = CharField(..., title="更新时间", min_length=19, max_length=19, examples=[Demo.dt_str])


class FamilyPositionDetailVO(FamilyPositionListVO):
    """ 家庭 | 位置 | 列表 | VO """

    create_time: str = CharField(..., title="创建时间", min_length=19, max_length=19, examples=[Demo.date_str])
    description: StrOrNone = CharField(None, title="描述", max_length=256)


class FamilyPositionListPage(VOPage[FamilyPositionListVO]):
    """ 家庭 | 位置 | 列表 | 分页 """
